package com.editso.haier.dao;

import com.editso.haier.entity.Tag;
import org.springframework.data.jpa.repository.Query;

import java.util.Optional;
import java.util.Set;


public interface TagDao extends Dao<Tag, Integer>{

    Optional<Tag> findByName(String name);

    boolean existsByName(String name);

    @Query(value="select * from tag where name=? limit 0, ?", nativeQuery = true)
    Set<Tag> findTagsByName(String name, int size);
}
